<?php
/**
 * This is the index.ctp of Administration Controller
 * @author Arsene Tochemey GANDOTE<arsene.gandote@yahoo.com>
 * @access public
 * @version 1.0
 * @copyright (c) 2011 - Tochemey. You are free to use this class.
 * 				  Modify it the way you want it.
 * 				  Please let me know about any modifications done.
 */
# Instance of Role Model
//$roleObj =  ClassRegistry::init('Role');
# List of all the roles in the system
//$roles = $roleObj->find('all', array('recursive' => -1, 'order' => 'Role.role_name ASC'));
# Intsance of Organisation Model
$OrgObj = ClassRegistry::init('Organisation');
# Get the Organisation data
$Org = $OrgObj->find('first', array('recursive' => -1));

# Instance of Module Model
$moduleObj =  ClassRegistry::init('Module');
# List of all the modules in the system
$allModules = $moduleObj->find('all', array('conditions'=>array('Module.active'=>1),'recursive' => -1, 'order' => 'Module.name ASC')); 
/**
# Instance of Module Model For Config
$moduleConfigObj =  ClassRegistry::init('Module');
# List of all the modules in the system
//$allConfigModules = $moduleConfigObj->find('all', array('recursive' => -1, 'order' => 'Module.name ASC'));
$allConfigModules = Hash::combine($moduleConfigObj->find('all', array('recursive' => -1, 'order' => 'Module.name ASC')), '{n}.Module.id', '{n}.Module');
*/

$configObj =  ClassRegistry::init('Configuration');
# List of all the modules in the system
$allConfiguration =  Hash::combine($configObj->find('all', array('recursive' => -1, 'order' => 'Configuration.key ASC')), '{n}.Configuration.id', '{n}.Configuration');

$loggedUser =  $this->Session->read('userSessionData');
$loggedUser_id = $loggedUser['id'];
$modified_date = date('Y-m-d H:i:s');
$created_date = date('Y-m-d H:i:s');

?>
<div class="user-pane" >
   <div class="pane-header">
       System Users Panel
   </div>
   
   <table id="userflex" style="display:none;"></table>
   
  <?php echo $this->element('administration/user_form_element') ;?>
      
</div>

<div class="config-pane" style="display: none;">
     <?php echo $this->element('administration/config_pane_element') ;?>
</div>

<!--
<div class="modules-pane" style="display: none;" >
     <?php echo $this->element('administration/modules_pane_element') ;?>
</div> -->


<div class="system-configuration-pane" style="display: none;" >
     <?php echo $this->element('administration/system_pane_element') ;?>
</div>

<input type="hidden" id="table-url" value="<?php echo $this->Html->url(array('controller' => 'Administration', 'action' => 'getUsers')); ?>" />
<input type="hidden" id="add-edit-url" value="<?php echo $this->Html->url(array('controller' => 'Administration', 'action' => 'add')); ?>" />
<input type="hidden" id="load-user-url" value="<?php echo $this->Html->url(array('controller' => 'Administration', 'action' => 'loadUser')); ?>" />
<input type="hidden" id="delete-url" value="<?php echo $this->Html->url(array('controller' => 'Administration', 'action' => 'deleteUsers')); ?>" />
